<ion-navbar *navbar primary>
    <ion-title>搜索主播</ion-title>
    <ion-buttons end>
        <button [navPush]="addStar">
            <ion-icon name="add"></ion-icon>
        </button>
    </ion-buttons>
</ion-navbar>

<ion-toolbar primary>
    <ion-searchbar placeholder="您要关注的主播..." (input)="getItems($event)"></ion-searchbar>
</ion-toolbar>

<ion-content>
    <ion-list>
        <ion-list-header *ngIf="stars || searchFailed">搜索结果</ion-list-header>
        <ion-item *ngFor="#star of stars" (click)="showAction(star)">
            <ion-avatar item-left>
                <img [src]="star.avatar">
            </ion-avatar>
            <img [src]="star.cover" style="width: 100%;">
            <h2><ion-badge secondary *ngIf="star.is_live">在线</ion-badge>
                <ion-badge danger *ngIf="!star.is_live">休息</ion-badge> {{star.nickname}}</h2>
            <p>{{star.title}}</p>
        </ion-item>
        <ion-item *ngIf="searchFailed">
            未找到相关主播
        </ion-item>
    </ion-list>
</ion-content>